﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Game1942.Library.Background;

namespace Game1942.Library.FlightPlans
{
    public class Vstrategy : DiagonalStrategy
    {
        public Vstrategy(int speed): base(speed)
        {
        }


        public override Point GetNext()
        {
            if (actualPosition == null)
                throw new InvalidOperationException("FlightPlan must be initialized!");
            UpdateSense();
            actualPosition.Plus(new Point(speed, currentSense*speed));
            return new Point(actualPosition);
        }

        public override Point ActualPosition
        {
            set
            {
                actualPosition = new Point(value);
                cycle = (Background.Background.Instance.GetDimension().X - value.X) / 2;
            }
        }
    }
}
